//
//  MHMomentHeaderView.m
//  MHDevelopExample
//
//Created by acgera on 2018/4/9.
//  Copyright © 2018年 acgera. All rights reserved.
//  圈正文

#import "MHMomentHeaderView.h"
#import "MHMomentPhotosView.h"
#import "MHMomentShareInfoView.h"
#import "MHMomentItemViewModel.h"
#import "MHMomentOperationMoreView.h"
#import "MHMomentVideoView.h"
#import "MHDetailMomentHeaderBottomView.h"
#import "NSString+Extension.h"

@interface MHMomentHeaderView ()
/// 头像
@property (nonatomic, readwrite, weak) UIImageView *avatarView;
/// 昵称
@property (nonatomic, readwrite, weak) YYLabel *screenNameLable;
/// 正文
@property (nonatomic, readwrite, weak) YYLabel *contentLable;

@property (nonatomic, readwrite, weak) YYLabel *anserLable;
/// 时间
@property (nonatomic, readwrite, weak) YYLabel *createAtLable;
/// 位置
@property (nonatomic, readwrite, weak) YYLabel *locationLable;

@property(nonatomic, strong) YYLabel *broserLable;

///收藏按钮
@property(nonatomic, weak) UIButton *collectButton;

@property(nonatomic, weak) UIButton *topButton;

@property(nonatomic, weak) UIButton *arrowDown;

/// //圈子名字
@property (nonatomic, readwrite, weak) YYLabel *sourceLable;
/// 更多按钮
@property (nonatomic, readwrite, weak) UIButton *operationMoreBtn;
/// 全文/收起 按钮
@property (nonatomic, readwrite, weak) UIButton *expandBtn;
/// 配图View
@property (nonatomic, readwrite, weak) MHMomentPhotosView *photosView;
/// 分享View
@property (nonatomic, readwrite, weak) MHMomentShareInfoView *shareInfoView;
/// videoView
@property (nonatomic, readwrite, weak) MHMomentVideoView *videoView;
/// upArrow
@property (nonatomic, readwrite, weak) UIImageView *upArrowView;
/// 更多操作view
@property (nonatomic, readwrite, weak) MHMomentOperationMoreView *operationMoreView;
/// viewModel
@property (nonatomic, readwrite, strong) MHMomentItemViewModel *viewModel;

@property(nonatomic, strong) UIView *clearBgView;


@property(nonatomic, strong) MHCommetHeaderBottomBar *bottomBar;
@property(nonatomic, strong) MHDetailMomentHeaderBottomView *detailBottomView;
@end


@implementation MHMomentHeaderView
/// init
+ (instancetype)headerViewWithTableView:(UITableView *)tableView{
    static NSString *ID = @"MomentHeader";
    MHMomentHeaderView *header = [tableView dequeueReusableHeaderFooterViewWithIdentifier:ID];
    if (header == nil) {
        // 缓存池中没有, 自己创建
        header = [[self alloc] initWithReuseIdentifier:ID];
    }
    return header;
}

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        // 初始化
        [self _setup];
        
        // 初始化所有的子控件
        [self _setupSubViews];
        
        // 所有事件处理（PS：为了将UI和事件隔离）
        [self _dealWithAction];
    }
    return self;
}


#pragma mark - 公共方法
- (void)bindViewModel:(MHMomentItemViewModel *)viewModel{
    dispatch_async(dispatch_get_main_queue(), ^{
        self.viewModel = viewModel;
        //收藏按钮
        self.collectButton.selected = self.viewModel.moment.isHaveCollect;
        if (viewModel.isCollection) {
            self.collectButton.selected = YES;
        }
        
        /// 头像
        self.avatarView.frame = viewModel.avatarViewFrame;
        self.avatarView.layer.cornerRadius = self.avatarView.mh_width / 2;
        self.avatarView.layer.masksToBounds = YES;
        [self.avatarView yy_setImageWithURL:[NSURL URLWithString:viewModel.moment.allPublishUserHeadPic] placeholder:MHDefaultAvatar(MHDefaultAvatarTypeDefualt) options:YYWebImageOptionAllowInvalidSSLCertificates|YYWebImageOptionAllowBackgroundTask completion:nil];
        /// 昵称
        self.screenNameLable.textLayout = viewModel.screenNameLableLayout;
        self.screenNameLable.frame = viewModel.screenNameLableFrame;
        
        /// 时间
        self.createAtLable.textLayout = viewModel.createAtLableLayout;
        self.createAtLable.frame = viewModel.createAtLableFrame;
        
        
        self.broserLable.textLayout = viewModel.broserLabelLayout;
        self.broserLable.frame = viewModel.broserLableFrame;
        
        /// 来源
        self.sourceLable.textLayout = viewModel.sourceLableLayout;
        self.sourceLable.frame = viewModel.sourceLableFrame;
        
        /// 正文
        self.contentLable.textLayout = viewModel.contentLableLayout;
        self.contentLable.frame = viewModel.contentLableFrame;
        
        
        self.anserLable.textLayout = viewModel.anserLableLayout;
        self.anserLable.frame = viewModel.anserLableFrame;
        
        /// 全文/收起
        self.expandBtn.frame = viewModel.expandBtnFrame;
        [self.expandBtn setTitle:viewModel.isExpand?@"收起":@"全文" forState:UIControlStateNormal];
        
        /// 配图
        self.photosView.frame = viewModel.photosViewFrame;
        [self.photosView bindViewModel:viewModel];
        
        /// 分享
        self.shareInfoView.hidden = !(viewModel.moment.type == MHMomentExtendTypeAsk);
        self.shareInfoView.frame = viewModel.shareInfoViewFrame;
        [self.shareInfoView bindViewModel:viewModel];
        
        /// 视频
        self.videoView.hidden = !(viewModel.moment.type == MHMomentExtendTypeVideo);
        self.videoView.frame = viewModel.videoViewFrame;
        [self.videoView bindViewModel:viewModel];
        
        /// 位置
        self.locationLable.textLayout = viewModel.locationLableLayout;
        self.locationLable.frame = viewModel.locationLableFrame;
        
        
        self.topButton.frame  = viewModel.topButtonFrame;
        
        self.collectButton.frame = viewModel.collectionBtnFrame;
        self.arrowDown.frame = viewModel.arrowDownBtnFrame;
        
        /// 箭头
        self.upArrowView.frame = viewModel.upArrowViewFrame;
        
        self.bottomBar.frame = viewModel.bottomBarFrame;
        
        
        //布局全部
        self.bottomBar.frame = viewModel.bottomBarFrame;
        self.detailBottomView.frame = viewModel.bottomBarFrame;
        if (self.viewModel.moment.attitudesCount > 0) {
            [self.bottomBar.attributeBtn setTitle:[NSString stringWithFormat:@" %d",self.viewModel.moment.attitudesCount] forState:0];
        }else
        {
            [self.bottomBar.attributeBtn setTitle:@"" forState:0];
        }
        
        if (self.viewModel.moment.commentCount) {
            [self.bottomBar.comentBtn setTitle:[NSString stringWithFormat:@" %@",[NSString formatCount:self.viewModel.moment.commentCount]] forState:0];
        }else
        {
            [self.bottomBar.comentBtn setTitle:@"" forState:0];
        }
        
//        @weakify(self);
//        [RACObserve(self.viewModel.moment, commentCount) subscribeNext:^(NSArray *array) {
//            @strongify(self);
//            if (array.count > 0) {
//                [self.bottomBar.comentBtn setTitle:[NSString stringWithFormat:@" %d",array.count] forState:0];
//            }else
//            {
//                [self.bottomBar.comentBtn setTitle:@"" forState:0];
//            }
//        }];
        
        self.expandBtn.hidden = self.viewModel.isDetail;
        self.broserLable.hidden = !self.viewModel.isDetail;
        
        
        if (self.viewModel.isDetail) {
            self.sourceLable.hidden = YES;
        }
        //隐藏按钮处理
        if (self.viewModel.isDetail) {
            if (self.viewModel.isRealateToMe && self.viewModel.moment.recentType == MHRecentContentTypeAsk && !self.viewModel.moment.isReplay) {
                self.detailBottomView.hidden = false;
                self.arrowDown.hidden = YES;
            }else
            {
                self.detailBottomView.hidden = false;
            }
            self.bottomBar.hidden = YES;
        }else
        {
            self.detailBottomView.hidden = YES;
        }
        if (self.viewModel.isCollection) {
            self.arrowDown.hidden = YES;
            self.bottomBar.hidden = YES;
            self.collectButton.hidden = NO;
            self.collectButton.mh_right = self.arrowDown.mh_right - 15;
        }else
        {
            if (self.viewModel.isFootPrint) {
                self.arrowDown.hidden = YES;
                self.bottomBar.hidden = YES;
            }
            self.collectButton.hidden = YES;
        }
        
        if (self.viewModel.isTheme || self.viewModel.isDetail) {
            self.topButton.hidden = !self.viewModel.moment.isTop;
        }
        
        
        self.clearBgView.frame = CGRectMake(0, 0, self.mh_width, self.height - 40);
        self.bottomBar.attributeBtn.selected = self.viewModel.moment.attitudesStatus;
        self.detailBottomView.attributeButton.selected = self.viewModel.moment.attitudesStatus;
    });
}

-(void)layoutSubviews
{
    [super layoutSubviews];
}

-(void)dealloc
{
    
}

#pragma mark - 私有方法
- (void)_dealWithAction{
    /// 该界面的所有事件监听
    @weakify(self);
    /// 用户头像 （点击、长按）事件
    UITapGestureRecognizer *tapGr = [[UITapGestureRecognizer alloc] init];
    [self.avatarView addGestureRecognizer:tapGr];
    [tapGr.rac_gestureSignal subscribeNext:^(UIGestureRecognizer * gr) {
        /// 点击事件
        
        @strongify(self);
        [self.viewModel.profileInfoCommand execute:self.viewModel.moment.user];
    }];
    /// 昵称点击事件
    [self.screenNameLable setHighlightTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
        /// 点击事件
        @strongify(self);
        [self.viewModel.profileInfoCommand execute:self.viewModel.moment.user];
    }];
    
    /// 正文点击事件
    [self.contentLable setHighlightTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
        /// 点击事件
        @strongify(self);
        if (range.location >= text.length) return;
        YYTextHighlight *highlight = [text yy_attribute:YYTextHighlightAttributeName atIndex:range.location];
        NSDictionary *userInfo = highlight.userInfo;
        if (userInfo.count == 0) return;
        /// 回调数据
        [self.viewModel.attributedTapCommand execute:userInfo];
    }];
    
    /// 地理位置
    [self.locationLable setHighlightTapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) {
        /// 点击事件
        @strongify(self);
        if (range.location >= text.length) return;
        YYTextHighlight *highlight = [text yy_attribute:YYTextHighlightAttributeName atIndex:range.location];
        NSDictionary *userInfo = highlight.userInfo;
        if (userInfo.count == 0) return;
        /// 回调数据
        [self.viewModel.attributedTapCommand execute:userInfo];
    }];
    
    /// 全文/收起 事件监听
    [[self.expandBtn rac_signalForControlEvents:UIControlEventTouchUpInside]
     subscribeNext:^(UIButton *sender) {
         @strongify(self);
         /// 更新子控件的frame
         [self.viewModel.expandOperationCmd execute:@(self.section)];
     }];
    
    
    [[self.collectButton rac_signalForControlEvents:UIControlEventTouchUpInside]
     subscribeNext:^(UIButton *sender) {
         @strongify(self);
         /// 更新子控件的frame
         [[self.viewModel.collectionCommand execute: @{@"isCollection":@(sender.selected),@"section":@(self.section)}] subscribeNext:^(id x) {
             @strongify(self);
             self.collectButton.selected =  !self.collectButton.selected;
             
         }];
     }];
    
    /// 更多按钮点击
    [[self.operationMoreBtn rac_signalForControlEvents:UIControlEventTouchUpInside]
     subscribeNext:^(UIButton *sender) {
         @strongify(self);
         /// 这里实现判断 键盘是否已经抬起
         if (MHSharedAppDelegate.isShowKeyboard) {
             [MHSharedAppDelegate.window endEditing:YES]; /// 关掉键盘
         }else{
             /// 固定位置
             self.operationMoreView.right = self.operationMoreBtn.mh_x - MHMomentContentInnerMargin;
             self.operationMoreView.isShow?[self.operationMoreView hideWithAnimated:YES]:[self.operationMoreView showWithAnimated:YES];
             [self layoutIfNeeded];
         }
         
     }];
    
    
    [self.bottomBar.attributeBtn bk_whenTapped:^{
        @strongify(self);
        [[self.viewModel.attitudeOperationCmd execute:@(self.section)] subscribeNext:^(id x) {
        }];
    }];
    
    [self.bottomBar.transferBtn bk_whenTapped:^{
        @strongify(self);
        [MHMomentHelper hideAllPopViewWithAnimated:YES];
        [self.viewModel.shareMomentCommand execute:self.viewModel.moment];
    }];
    
    [self.detailBottomView.attributeButton bk_whenTapped:^{
        @strongify(self);
        [[self.viewModel.attitudeOperationCmd execute:@(self.section)] subscribeNext:^(id x) {
        }];
    }];
    
    [self.detailBottomView.shareButton bk_whenTapped:^{
        @strongify(self);
        [self.viewModel.shareMomentCommand execute:self.viewModel.moment];
    }];
    
    [self.bottomBar.comentBtn bk_whenTapped:^{
        @strongify(self);
        if (self.viewModel.isDetail) {
            [self.viewModel.commentSubject sendNext:@(self.section)];
        }else
        {
             [self.viewModel.didSelectCommand execute:@(self.section)];
        }
        
    }];
    
    /// 评论
    self.operationMoreView.commentClickedCallback = ^(MHMomentOperationMoreView *operationMoreView) {
        @strongify(self);
        [self.viewModel.commentSubject sendNext:@(self.section)];
    };
}




/// 以下UI部分 不必过多关注
#pragma mark - 初始化
- (void)_setup{
    self.contentView.backgroundColor = [UIColor whiteColor];
    //处理闪烁问题;
    self.detailBottomView.hidden = YES;
    self.expandBtn.hidden = YES;
    self.broserLable.hidden = YES;
    self.arrowDown.hidden = YES;
    self.collectButton.hidden = YES;
    self.topButton.hidden = YES;
}

#pragma mark - 创建自控制器
- (void)_setupSubViews{
    //// PS:这里把所有可能要显示的View全部初始化好，避免滚动过程中的动态创建，影响性能
    
    
    [self.contentView addSubview:self.clearBgView];
    /// 用户头像
    UIImageView *avatarView = [[UIImageView alloc] init];
    avatarView.backgroundColor = self.contentView.backgroundColor;
    /// 设置可交互
    avatarView.userInteractionEnabled = YES;
    self.avatarView = avatarView;
    [self.contentView addSubview:avatarView];
    
    
    
    /// 昵称
    YYLabel *screenNameLable = [[YYLabel alloc] init];
    screenNameLable.backgroundColor = self.contentView.backgroundColor;
    /// 垂直方向中心对齐
    screenNameLable.textVerticalAlignment = YYTextVerticalAlignmentCenter;
    /// 异步渲染和布局
    screenNameLable.displaysAsynchronously = NO;
    /// 利用textLayout来设置text、font、textColor...
    screenNameLable.ignoreCommonProperties = YES;
    screenNameLable.fadeOnAsynchronouslyDisplay = NO;
    screenNameLable.fadeOnHighlight = NO;
    [self.contentView addSubview:screenNameLable];
    self.screenNameLable = screenNameLable;
    
    //收藏按钮
    UIButton *collectionBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [collectionBtn setImage:[UIImage imageNamed:@"circle_collectionnor"] forState:0];
    [collectionBtn setImage:[UIImage imageNamed:@"circle_startyellow"] forState:UIControlStateSelected];
    self.collectButton = collectionBtn;
    [self addSubview:collectionBtn];
    
    //置顶按钮
    UIButton *topButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [topButton setImage:[UIImage imageNamed:@"circle_toprecent"] forState:0];
    self.topButton = topButton;
    self.topButton.hidden = YES;
    [self addSubview:topButton];
    
    
    @weakify(self);
    UIButton *arrowDownButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [arrowDownButton setImage:[UIImage imageNamed:@"circle_arrowdown"] forState:0];
    [[arrowDownButton rac_signalForControlEvents:UIControlEventTouchUpInside]
     subscribeNext:^(UIButton *sender) {
         @strongify(self);
         [MHMomentHelper hideAllPopViewWithAnimated:YES];
         [self.viewModel.showBottomMenuViewCommand execute:@(self.section)];
     }];
    self.arrowDown = arrowDownButton;
    [self addSubview:arrowDownButton];
    
    
    /// 正文
    YYLabel *contentLable = [[MHYYCopyLabel alloc] init];
    contentLable.backgroundColor = self.contentView.backgroundColor;
    /// 垂直方向顶部对齐
    contentLable.textVerticalAlignment = YYTextVerticalAlignmentTop;
    /// 异步渲染和布局
    contentLable.displaysAsynchronously = NO;
    /// 利用textLayout来设置text、font、textColor...
    contentLable.ignoreCommonProperties = YES;
    contentLable.fadeOnAsynchronouslyDisplay = NO;
    contentLable.fadeOnHighlight = NO;
    contentLable.preferredMaxLayoutWidth = MHMomentCommentViewWidth();
    [self.contentView addSubview:contentLable];
    self.contentLable = contentLable;
    
    
    
    YYLabel *anserLable = [[YYLabel alloc] init];
    anserLable.backgroundColor = self.contentView.backgroundColor;
    /// 垂直方向顶部对齐
    anserLable.textVerticalAlignment = YYTextVerticalAlignmentTop;
    /// 异步渲染和布局
    anserLable.displaysAsynchronously = NO;
    /// 利用textLayout来设置text、font、textColor...
    anserLable.ignoreCommonProperties = YES;
    anserLable.fadeOnAsynchronouslyDisplay = NO;
    anserLable.fadeOnHighlight = NO;
    anserLable.preferredMaxLayoutWidth = MHMomentCommentViewWidth();
    [self.contentView addSubview:anserLable];
    self.anserLable = anserLable;
    
    
    /// photosView
    MHMomentPhotosView *photosView = [[MHMomentPhotosView alloc] init];
    photosView.clipsToBounds = YES;
    photosView.backgroundColor = self.contentView.backgroundColor;
    self.photosView = photosView;
    [self.contentView addSubview:photosView];
    
    /// shareInfoView
    MHMomentShareInfoView *shareInfoView = [MHMomentShareInfoView shareInfoView];
    self.shareInfoView = shareInfoView;
    [self.contentView addSubview:shareInfoView];
    
    /// videoView
    MHMomentVideoView *videoView = [MHMomentVideoView videoView];
    self.videoView = videoView;
    [self.contentView addSubview:videoView];
    
    /// 位置
    YYLabel *locationLable = [[YYLabel alloc] init];
    locationLable.backgroundColor = self.contentView.backgroundColor;
    /// 垂直方向中心对齐
    locationLable.textVerticalAlignment = YYTextVerticalAlignmentCenter;
    /// 异步渲染和布局
    locationLable.displaysAsynchronously = NO;
    /// 利用textLayout来设置text、font、textColor...
    locationLable.ignoreCommonProperties = NO;
    locationLable.fadeOnAsynchronouslyDisplay = NO;
    locationLable.fadeOnHighlight = NO;
    [self.contentView addSubview:locationLable];
    self.locationLable = locationLable;
    
    /// 创建时间
    YYLabel *createAtLable = [[YYLabel alloc] init];
    createAtLable.backgroundColor = self.contentView.backgroundColor;
    /// 垂直方向中心对齐
    createAtLable.textVerticalAlignment = YYTextVerticalAlignmentCenter;
    /// 异步渲染和布局
    createAtLable.displaysAsynchronously = NO;
    /// 利用textLayout来设置text、font、textColor...
    createAtLable.ignoreCommonProperties = YES;
    createAtLable.fadeOnAsynchronouslyDisplay = NO;
    createAtLable.fadeOnHighlight = NO;
    [self.contentView addSubview:createAtLable];
    self.createAtLable = createAtLable;
    
    YYLabel *broserLable = [[YYLabel alloc] init];
    broserLable.backgroundColor = self.contentView.backgroundColor;
    /// 垂直方向中心对齐
    broserLable.textVerticalAlignment = YYTextVerticalAlignmentCenter;
    /// 异步渲染和布局
    broserLable.displaysAsynchronously = NO;
    /// 利用textLayout来设置text、font、textColor...
    broserLable.ignoreCommonProperties = YES;
    broserLable.fadeOnAsynchronouslyDisplay = NO;
    broserLable.fadeOnHighlight = NO;
    [self.contentView addSubview:broserLable];
    self.broserLable = broserLable;
    
    /// 来源
    YYLabel *sourceLable = [[YYLabel alloc] init];
    sourceLable.backgroundColor = self.contentView.backgroundColor;
    /// 垂直方向中心对齐
    sourceLable.textVerticalAlignment = YYTextVerticalAlignmentCenter;
    /// 异步渲染和布局
    sourceLable.displaysAsynchronously = NO;
    /// 利用textLayout来设置text、font、textColor...
    sourceLable.ignoreCommonProperties = YES;
    sourceLable.fadeOnAsynchronouslyDisplay = NO;
    sourceLable.fadeOnHighlight = NO;
    [self.contentView addSubview:sourceLable];
    self.sourceLable = sourceLable;
    
    
    /// 更多操作按钮
    UIButton *operationMoreBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [operationMoreBtn setImage:MHImageNamed(@"wx_albumOperateMore_25x25") forState:UIControlStateNormal];
    [operationMoreBtn setImage:MHImageNamed(@"wx_albumOperateMoreHL_25x25") forState:UIControlStateHighlighted];
    [self.contentView addSubview:operationMoreBtn];
    operationMoreBtn.backgroundColor = self.contentView.backgroundColor;
    self.operationMoreBtn = operationMoreBtn;
    
    
    /// 展开、关闭按钮
    UIButton *expandBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [expandBtn setTitle:@"全文" forState:UIControlStateNormal];
    [expandBtn setTitleColor:MHMomentScreenNameTextColor forState:UIControlStateNormal];
    [expandBtn.titleLabel setFont:MHMomentExpandTextFont];
    [expandBtn setBackgroundImage:[UIImage yy_imageWithColor:MHMomentTextHighlightBackgroundColor size:CGSizeMake(MHMomentExpandButtonWidth, MHMomentExpandButtonHeight)] forState:UIControlStateHighlighted];
    /// 子控件超出部分裁剪
    expandBtn.clipsToBounds = YES;
    [self.contentView addSubview:expandBtn];
    self.expandBtn = expandBtn;
    
    /// 向上的箭头
    UIImageView *upArrowView = [[UIImageView alloc] initWithImage:MHImageNamed(@"wx_albumTriangleB_45x6")];
    self.upArrowView = upArrowView;
    [self.contentView addSubview:upArrowView];
    
    /// 更多操作
    MHMomentOperationMoreView *operationMoreView = [[MHMomentOperationMoreView alloc] init];
    [self.contentView addSubview:operationMoreView];
    self.operationMoreView = operationMoreView;
    
    ///底部按钮
    [self.contentView addSubview:self.detailBottomView];
    [self.contentView addSubview:self.bottomBar];
    
    
}



-(MHDetailMomentHeaderBottomView *)detailBottomView
{
    if (!_detailBottomView) {
        _detailBottomView =[MHDetailMomentHeaderBottomView mh_viewFromXib];
        _detailBottomView.hidden = YES;
        return _detailBottomView;
    }
    return _detailBottomView;
}

-(UIView *)clearBgView
{
    if (!_clearBgView) {
        _clearBgView = [UIView new];
        @weakify(self);
        [_clearBgView bk_whenTapped:^{
            @strongify(self);
            [self.viewModel.didSelectCommand execute:@(self.section)];
        }];
    }
    return _clearBgView;
}


-(MHCommetHeaderBottomBar *)bottomBar
{
    if (!_bottomBar) {
        _bottomBar =[MHCommetHeaderBottomBar mh_viewFromXib];
        return _bottomBar;
    }
    return _bottomBar;
}


@end
